﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExpressionEvaluator;
using ExpressionEvaluator.Expression;
using Calculator.Expression.Atom;

namespace Calculator.Expression.Unary
{
    public class Cos : UnaryAbstract
    {
        int priority;

        public Cos(Expr v)
        {
            Value = Math.Cos(v.Value);
        }

        public override string  ToString()
        {
            return Value.ToString();
        }

        public override string Name
        {
            get { return "Cos(" + Value.ToString() + ")"; }
        }

        public override Expr diff(Expr expr)
        {
            return new Sin(new Constant(Value));
        }
    }
}
